namespace graver
{
    /// <summary>
    /// 语法树节点
    /// </summary>
    public class BinaryExpressionSyntax : ExpressionSyntaxNode
    {
        public BinaryExpressionSyntax(ExpressionSyntaxNode left, SyntaxToken operatorToken, ExpressionSyntaxNode right)
        {
            Left = left;
            OperatorToken = operatorToken;
            Right = right;
        }

        public override SyntaxKind Kind => SyntaxKind.BinaryExpression;

        public ExpressionSyntaxNode Left { get; }
        public SyntaxToken OperatorToken { get; }
        public ExpressionSyntaxNode Right { get; }

        public override IEnumerable<SyntaxNode> GetChildren()
        {
            yield return Left;
            yield return OperatorToken;
            yield return Right;
        }
    }

}

